//package com.example.admin.yuejian_22.Adapter;
//
//import android.content.Context;
//import android.support.v7.widget.RecyclerView;
//import android.view.LayoutInflater;
//import android.view.View;
//import android.view.ViewGroup;
//import android.widget.RatingBar;
//import android.widget.TextView;
//
//import com.example.admin.yuejian_22.Bean.CommentBean;
//import com.example.admin.yuejian_22.Bean.PhotoBean;
//import com.example.admin.yuejian_22.R;
//
//import java.util.List;
//
///**
// * Created by Admin on 2017/11/3.
// */
//
//public class CommentAdapter extends RecyclerView.Adapter {
//    private List<CommentBean> commentBean;
//    private Context context;
//    private LayoutInflater LayoutInflater;
//    public CommentAdapter(Context context, List<CommentBean> commentBean) {
//        this.context = context;
//       this.commentBean = commentBean;
//        LayoutInflater = LayoutInflater.from(context);
//    }
//    public void getCommentlist(List<CommentBean> commentBean)
//    {
//        this.commentBean= commentBean ;
//    }
//    @Override
//    public RecyclerView.ViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
//        View view = LayoutInflater.from(parent.getContext()).inflate(R.layout.item_comment, parent, false);
//        return new ViewHolder(view);
//    }
//
//    @Override
//    public void onBindViewHolder(RecyclerView.ViewHolder holder, int position) {
//        final CommentBean entity = commentBean.get(position);
//        if (null == entity) return;
//       ViewHolder viewHolder = (ViewHolder) holder;
//        viewHolder.time.setText(entity.getReply_time());
//        viewHolder.intro.setText(entity.getReply());
//
//    }
//    public class ViewHolder extends RecyclerView.ViewHolder {
//        private TextView time;
//        private TextView intro;
//
//
//        public ViewHolder(View itemView) {
//            super(itemView);
//            time = (TextView) itemView.findViewById(R.id.comment_time);
//            intro = (TextView) itemView.findViewById(R.id.comment_detail);
//
//        }
//    }
//
//    @Override
//    public int getItemCount() {
//        return commentBean.size();
//    }
//}
package com.example.admin.yuejian_22.Adapter;

import android.app.Activity;
import android.content.Context;
import android.support.v7.widget.RecyclerView;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.RatingBar;
import android.widget.TextView;

import com.example.admin.yuejian_22.Bean.CommentBean;
import com.example.admin.yuejian_22.Bean.PhotoBean;
import com.example.admin.yuejian_22.R;

import java.util.List;

/**
 * Created by Admin on 2017/11/3.
 */

public class CommentAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder> {
    private List<CommentBean> commentBean;
    private Context Context;
    private LayoutInflater LayoutInflater;
    public CommentAdapter(Context Context, List<CommentBean> commentBean) {
        this.Context = Context;
        this.commentBean = commentBean;
        LayoutInflater = LayoutInflater.from(Context);
    }
    public void getCommentlist(List<CommentBean> commentBean)
    {
        this.commentBean= commentBean ;
    }
    @Override
    public RecyclerView.ViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
        View view = LayoutInflater.from(parent.getContext()).inflate(R.layout.item_comment, parent, false);
        return new CommentAdapter.ViewHolder(view);
    }

    @Override
    public void onBindViewHolder(RecyclerView.ViewHolder holder, int position) {
        final CommentBean entity = commentBean.get(position);
            if (null == entity) return;
        ViewHolder viewHolder = (ViewHolder) holder;
        viewHolder.time.setText(entity.getReply_time());
        viewHolder.intro.setText(entity.getReply());

    }
    public class ViewHolder extends RecyclerView.ViewHolder {
        private TextView time;
        private TextView intro;


        public ViewHolder(View itemView) {
            super(itemView);
            time = (TextView) itemView.findViewById(R.id.comment_time);
            intro = (TextView) itemView.findViewById(R.id.comment_detail);

        }
    }

    @Override
    public int getItemCount() {
        return commentBean.size();
    }
}

